#ifndef CAMERA_H
#define CAMERA_H
#include <QObject>

class Camera : public QObject
{
    Q_OBJECT
public:
    Camera();

private:
    //     相机拍摄图片的序号下标
    int         m_nIndex;
    int         m_nMaxiumIndex;

private:
    //      该设备已经打开
    bool        m_bDevOpened;
    //      该设备正在采集
    bool        m_bIsSnapping;

public:
    int         GetIndex(){return m_nIndex;}
    void        SetIndex(int value){m_nIndex = value;}
    void        IncIndex(){m_nIndex++;m_nIndex %= m_nMaxiumIndex;}
    void        SetMaxiumIndex(int value){m_nMaxiumIndex = value;}

    bool        IsOpen(){return m_bDevOpened;}
    bool        IsSnap(){return m_bIsSnapping;}
    void        SetOpen(bool open){m_bDevOpened = open;}
    void        SetSnap(bool snap){m_bIsSnapping = snap;}

public:
    virtual int InitDevice(QString triggerMode = "Off") = 0;
    virtual int OnClose() = 0;
    virtual int OpenDevice() = 0;
    virtual int ConfigCaptureVideo() = 0;
    virtual int StopSnap() = 0;
    virtual int CloseDevice() = 0;
    virtual int StartSnap() = 0;
    virtual int TriggerSoftware() = 0;
    virtual int CaptureVideo() = 0;
    virtual int ClearWidget() = 0;

public:
    virtual QString GetIP() = 0;

    virtual int SaveBmp(const char* pFilePath) = 0;
    virtual int SaveJpeg(const char* pFilePath) = 0;
};

#endif // CAMERA_H
